<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    {{ num }}
    <button @click="sayHello">点我</button>
  </div>
  <!-- 导入js文件 -->
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <script>
    const mixinObj = {
      data () {
        return {
          num: 999
        }
      },
      created () {
        console.log('mixin-created')
      },
      methods: {
        sayHello() {
          console.log('你好啊');
        }
      }
    }


    new Vue({
      mixins: [mixinObj],
      el: "#app",
      data: {
        msg: '你好'
      },
      created () {
        console.log('vue-created')
      },
      methods: {
        // sayHello () {
        //   console.log('不,我不好,人间不值得')
        // }
      }
    });
  </script>
</body>

</html>